package com.tuanzi.loan.web.bean.family;

import com.tuanzi.loan.business.entity.family.LoanUnionForeignChannelInfo;
import com.tuanzi.loan.vo.request.family.LoanUnionForeignChannelInfoRequest;
import com.tuanzi.loan.web.configuration.JSFListingBean;
import com.tuanzi.loan.web.lazy.family.LoanUnionForeignChannelInfoLazyDataModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;

/**
 * User: liangZongXi
 * Create time: 16:50 2018/11/19
 * Description:
 */
@Data
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class LoanUnionForeignChannelInfoListBean extends JSFListingBean<LoanUnionForeignChannelInfoRequest, LoanUnionForeignChannelInfo> {
    private static final long serialVersionUID = -6911232565722457031L;

    @PostConstruct
    private void init() {
        initLazyDataModel();
    }

    private void initLazyDataModel() {
        $ = new LoanUnionForeignChannelInfoRequest();
        lazyDataModel = new LoanUnionForeignChannelInfoLazyDataModel($);
    }

    public void onRest(){
        initLazyDataModel();
    }

    public String toInfo(Integer id, String activityId){
        return redirect("/views/family/unionlogin/channel-info.xhtml?channelId="+ id + "&activityId=" + activityId);
    }

    public String add(){
        return redirect("/views/family/unionlogin/channel-info.xhtml");
    }
}
